package com.baozheyangken.ai_learn.mapper;

import com.baozheyangken.ai_learn.pojo.dto.KnowledgePageQueryDTO;
import com.baozheyangken.ai_learn.pojo.entity.Knowledge;
import com.baozheyangken.ai_learn.pojo.entity.QuestionKnowledge;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface KnowledgeMapper {
    void insertKnowledge(Knowledge knowledge);

    Page<Knowledge> pageQuery(KnowledgePageQueryDTO knowledgePageQueryDTO);

    Integer getQuestionCountByKnowledgeId(Long id);

    void updateKnowledge(Knowledge knowledge);

    Knowledge getKnowledgeById(Long id);

    void deleteKnowledgeById(Long knowledgeId);

    void deleteQuestionKnowledgeByKnowledgeId(Long knowledgeId);

    void deleteQuestionByKnowledgeId(List<Integer> questionIds);

    List<Integer> getQuestionIds(Long knowledgeId);

    List<Knowledge> getKnowledgeByCourseId(Long courseId);

    List<String> getKnowledgeTitlesByCourseId(Long courseId);

    List<Long> getKnowledgeIdsByTitleAndCourseId(String title, Long courseId);
    void insertQuestionKnowledge(Integer questionId, Long knowledgeId);
}
